package com.example.lib.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class TimeHandler implements InvocationHandler {
    private Object target;

    public TimeHandler(Object ob) {
        this.target = ob;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (args != null && args.length > 0) {
            method.invoke(target, args);
        } else {
            method.invoke(target);
        }
        return null;
    }
}
